home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 February: Tool Chest / Dev.CD Feb 00 TC.toast / pc / what's new? / sample code / human interface toolbox / packagetool / sample package / htmlsample sources / renderingwindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-02  |  4.1 KB  |  116 lines

  1. /*
  2.     file RenderingWindow.h
  3.     
  4.     Description:
  5.     This file contains exported routine prototypes that can be used to call
  6.     the routines defined in RenderingWindow.c.  These routines used to
  7.     manage the windows displayed by the HTMLSample application.
  8.     
  9.     HTMLSample is an application illustrating how to use the new
  10.     HTMLRenderingLib services found in Mac OS 9. HTMLRenderingLib
  11.     is Apple's light-weight HTML rendering engine capable of
  12.     displaying HTML files.
  13.  
  14.     Copyright: © 1999 by Apple Computer, Inc.
  15.     all rights reserved.
  16.     
  17.     Disclaimer:
  18.     You may incorporate this sample code into your applications without
  19.     restriction, though the sample code has been provided "AS IS" and the
  20.     responsibility for its operation is 100% yours.  However, what you are
  21.     not permitted to do is to redistribute the source as "DSC Sample Code"
  22.     after having made changes. If you're going to re-distribute the source,
  23.     we require that you make it clear in the source that the code was
  24.     descended from Apple Sample Code, but that you've made changes.
  25.     
  26.     Change History (most recent first):
  27.     10/16/99 created
  28. */
  29.  
  30. #ifndef __RENDERINGWINDOW__
  31. #define __RENDERINGWINDOW__
  32.  
  33. #include <Types.h>
  34. #include <Windows.h>
  35.  
  36.  
  37.  
  38. /* InitRenderingWindows is called to initialize the environment used by 
  39.     routines defined in this file.  It should be called before any of the 
  40.     other routines defined in this file are called. */
  41. OSStatus InitRenderingWindows(void);
  42.  
  43. /* CloseRenderingWindows closes any open rendering windows and
  44.     deallocates any structures allocated when InitRenderingWindows
  45.     was called. */
  46. OSStatus CloseRenderingWindows(void);
  47.  
  48.  
  49.  
  50. /* RWOpen opens a new, empty rendering window.  If successful,
  51.     then *rWindow will contain a pointer to a newly created window. */
  52. OSStatus RWOpen(WindowPtr *rWindow);
  53.  
  54. /* RWCloseWindow closes the rendering window pointed to by
  55.     rWin.  */
  56. void RWCloseWindow(WindowPtr rWin);
  57.  
  58. /* IsARenderingWindow returns true if rWin points to a rendering
  59.     window created by RWOpen. You should not call any of the routines
  60.     below for windows that are not rendering windows.  This routine
  61.     provides a convenient way to tell if a windowptr returned by one
  62.     of the toolbox routines is a rendering window. */
  63. Boolean IsARenderingWindow(WindowPtr rWin);
  64.  
  65.  
  66.  
  67. /* RWGotoURL displays HTML file referred to by the url in the
  68.     rendering window.  if addToHistory is true, then the window
  69.     will be added to the window's history list. */
  70. OSStatus RWGotoURL(WindowPtr rWin, char* url, Boolean addToHistory);
  71.  
  72. /* RWGotoAppRelLink displays HTML file referred to by the application
  73.     relative link in the rendering window.  if addToHistory is true, then
  74.     the window will be added to the window's history list. */
  75. OSStatus RWGotoAppRelLink(WindowPtr rWin, char* linkstr, Boolean addToHistory);
  76.  
  77.  
  78.  
  79. /* RWResetGotoMenu should be called before calling MenuKey or MenuSelect.  It
  80.     enables the back, forward, and home menu commands depending on what
  81.     commands are available and it rebuilds the history list at the bottom
  82.     of the go to menu. */
  83. void RWResetGotoMenu(WindowPtr rWin);
  84.  
  85. /* RWHandleGotoMenu should be called when an item is chosen from the
  86.     go to menu.  item is the number of the item that was chosen. */
  87. void RWHandleGotoMenu(WindowPtr rWin, short item);
  88.  
  89.  
  90.  
  91. /* RWUpdate should be called in response to an update event.
  92.     it calls BeginUpdate and EndUpdate redrawing the window's
  93.     contents as necessary. */
  94. void RWUpdate(WindowPtr rWin);
  95.  
  96. /* RWActivate should be called in response to activate events.*/
  97. void RWActivate(WindowPtr rWin, Boolean activate);
  98.  
  99. /* RWRecalculateSize should be called whenever the size of a rendering
  100.     window changes.  This routine resizes and redraws the windows
  101.     contents appropriately. */
  102. void RWRecalculateSize(WindowPtr rWin);
  103.  
  104. /* RWHandleMouseDown should be called in response to mouse down
  105.     events occuring inside of a rendering window.  This routine responds
  106.     to mouse clicks in the controls at the top of the window. */
  107. void RWHandleMouseDown(WindowPtr rWin, Point where);
  108.  
  109. /* RWKeyDown should be called for keydown events when a rendering
  110.     window is the frontmost window.  This routine maps the left, up,
  111.     and right arrow keys to the back, home, and forward commands. */
  112. void RWKeyDown(WindowPtr rWin, char theKey);
  113.  
  114. #endif
  115.  
  116.